<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Mednalytics</title>
    <!-- Iconic Fonts -->
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link href="../../vendors/iconic-fonts/font-awesome/css/all.min.css" rel="stylesheet">
    <link rel="stylesheet" href="../../vendors/iconic-fonts/flat-icons/flaticon.css">
    <link rel="stylesheet" href="../../vendors/iconic-fonts/cryptocoins/cryptocoins.css">
    <link rel="stylesheet" href="../../vendors/iconic-fonts/cryptocoins/cryptocoins-colors.css">
    <!-- Bootstrap core CSS -->
    <link href="../../assets/css/bootstrap.min.css" rel="stylesheet">
    <!-- Page Specific Css (Datatables.css) -->
    <link href="../../assets/css/datatables.min.css" rel="stylesheet">
    <!-- jQuery UI -->
    <link href="../../assets/css/jquery-ui.min.css" rel="stylesheet">
    <!-- Page Specific CSS (Slick Slider.css) -->
    <link href="../../assets/css/slick.css" rel="stylesheet">
    <!-- Mednalytics styles -->
    <link href="../../assets/css/style.css" rel="stylesheet">

    <!-- Favicon -->
    <link rel="icon" type="image/png" sizes="32x32" href="../../favicon.ico">
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body class="ms-body ms-aside-left-open ms-primary-theme ms-has-quickbar">
<!-- Setting Panel -->
<script src="../../assets/reuseCode/top.js"></script>
<!-- Body Content Wrapper -->
<!-- Body Content Wrapper -->
<div class="ms-content-wrapper" id="allpatients">
    <div class="row">
        <div class="col-md-12">
            <nav aria-label="breadcrumb">
                <ol class="breadcrumb pl-0">
                    <li class="breadcrumb-item"><a href="#"><i class="material-icons">home</i> 首页</a></li>
                    <li class="breadcrumb-item"><a href="#">病人</a></li>
                    <li class="breadcrumb-item active" aria-current="page">病人名单</li>
                </ol>
            </nav>
            <div class="ms-panel">
                <div class="ms-panel-header ms-panel-custome">
                    <h6>病人名单</h6>
                    <a href="add-patient.html" class="ms-text-primary">添加病人</a>
                </div>
                <div class="row">
                    <div class="col-sm-12">
                        <div id="aptable_wrapper" class="dataTables_wrapper dt-bootstrap4 no-footer">
                            <div class="row">
                                <div class="col-sm-12 col-md-6">
                                    <div class="dataTables_length" id="aptable_length">
                                        <label>显示
                                            <select id="select1" name="aptable_length" class="custom-select custom-select-sm form-control form-control-sm"  @change="loadAllPatients()">
                                                <option value="5">5</option>
                                                <option value="10">10</option>
                                                <option value="50">50</option>
                                            </select> 条/页
                                        </label>
                                    </div>
                                </div>
                                <div class="col-sm-12 col-md-6">
                                    <div id="aptable_filter" >
                                        <label>
                                            <input type="search" class="form-control form-control-sm"
                                                   placeholder="输入关键词查询" >
                                        </label>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <table id="1" class="table w-100 thead-primary dataTable no-footer" role="grid" style="width: 1588px;">
                                        <thead>
                                        <tr role="row" >
                                            <th style="width: 118px;">ID</th>
                                            <th  style="width: 190px;">患者姓名</th>
                                            <th   style="width: 83px;">年龄</th>
                                            <th   style="width: 140px;">性别</th>
                                            <th  style="width: 101px;">联系电话</th>
                                            <th  style="width: 134px;">主治医师</th>
                                            <th  style="width: 127px;">病历</th>
                                            <th style="width: 108px;">操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr role="row" class="odd" v-for="(patient,index) in patients" >
                                            <td  v-text="index+1"  >APT0001</td>
                                            <td ><img src="../../assets/img/dashboard/patient-1.jpg" v-bind:src="patient.headImg" alt="patient"><p v-text="patient.name"></p></td>
                                            <td v-text="patient.idCard">39</td>
                                            <td v-text="patient.gender">男</td>
                                            <td v-text="patient.phone" >1999999999</td>
                                            <td  v-text="patient.doctorName"><img src="../../assets/img/dashboard/patient-1.jpg">扁鹊</td>
                                            <td v-text="patient.history" >病历</td>
                                            <td >
                                                <a href="#mymodal" class="text-white"  data-toggle="modal">
                                                    <i class="fas fa-pencil-alt ms-text-primary mr-2" @click="loadTHePatient(patient)"></i>
                                                </a>
                                                <a href="#" class="text-white"><i class="far fa-trash-alt ms-text-danger mr-2" @click="deleteThePatient(patient.id)"></i>
                                                </a>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12 col-md-7">
                                    <div class="dataTables_paginate paging_simple_numbers" id="spacer24">
                                        <ul class="pagination has-gap">
                                            <li class="paginate_button page-item " id="4" >
                                                <a href="#" aria-controls="aptable"
                                                   class="page-item page-link" @click="loadAllPatients(pageInfo.prePage)">上一页</a>
                                            </li>
                                            <li class="paginate_button page-item "  v-for="n in pageInfo.navigatepageNums">
                                                <a href="" aria-controls="aptable" data-dt-idx="1" tabindex="0"
                                                   class="page-link" v-on:click.prevent="loadAllPatients(n)"
                                                v-bind:class="{'bg-secondary text-light':n==pageInfo.pageNum}"
                                                 v-text="n">1</a>
                                            </li>
                                            <li class="paginate_button page-item " id="5">
                                                <a href="#" aria-controls="aptable" data-dt-idx="3" tabindex="0"
                                                   class="page-item page-link"
                                                @click.prevent="loadAllPatients(pageInfo.nextPage)">下一页</a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
<!-- MODALS 编辑病人信息-->
<div class="modal fade" id="mymodal" tabindex="-1" role="dialog" style=" padding-right: 17px;">
    <div class="modal-dialog ms-modal-dialog-width">
        <div class="modal-content ms-modal-content-width">
            <div class="modal-header  ms-modal-header-radius-0">
                <h4 class="modal-title text-white">修改病人信息</h4>
                <button type="button" class="close text-white" data-dismiss="modal" aria-hidden="true">x</button>

            </div>
            <div class="modal-body p-0 text-left">
                <div class="col-xl-12 col-md-12">
                    <div class="ms-panel ms-panel-bshadow-none">
                        <div class="ms-panel-header">
                            <h6>病人信息:</h6>
                        </div>
                        <div class="ms-panel">
                            <div class="ms-panel-body">
                                <form class="needs-validation" novalidate @submit.prevent="submitpatient(patient)">
                                    <div class="form-row">
                                        <div class="col-md-3 mb-3">
                                            <label for="validationCustom002">姓 名</label>
                                            <div class="input-group">
                                                <input type="text" class="form-control" id="validationCustom002" placeholder="输入姓氏"
                                                       v-model="patient.name" required>
                                            </div>
                                        </div>
                                        <div class="col-md-3 mb-2">
                                            <label for="validationCustom004">身份证号</label>
                                            <div class="input-group">
                                                <input type="text" class="form-control" id="validationCustom004"
                                                       placeholder="输入身份证号" v-model="patient.idCard" required>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-row">
                                        <div class="col-md-3 mb-3">
                                            <label>所属科室</label>
                                            <div class="input-group">
                                                <select class="form-control" id="validationCustom220"  v-model="officeId" @change="loadDoctors(this.officeId)" >
                                                    <option value="ABC" selected>请选择---</option>
                                                    <option  v-for="department in departments" :value="department.officeId" v-text="department.officeName">泌尿科</option>

                                                </select>

                                            </div>
                                        </div>

                                        <div class="col-md-3 mb-3">
                                            <label>主治医师</label>
                                            <div class="input-group">
                                                <select class="form-control" v-model="patient.doctorId" id="mydoc" required>
                                                    <option value="" selected>请选择---</option>
                                                    <option value="" v-for="doctor in doctors" :value="doctor.id" v-text="doctor.name">牛魔王</option>


                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-row">
                                        <div class="col-md-3 mb-2">
                                            <label for="validationCustom003">患者电话</label>
                                            <div class="input-group">
                                                <input type="text" class="form-control" id="validationCustom003"
                                                       placeholder="输入电话号码" v-model="patient.phone" required>
                                            </div>
                                        </div>
                                        <div class="col-md-3 mb-3">
                                            <label>上传头像</label>
                                            <div class="custom-file">
                                                <input type="file" class="custom-file-input" id="validatedCustomFile"  @change="getFile($event)" accept="image/*">
                                                <label class="custom-file-label" for="validatedCustomFile" v-text="file.name">选择文件...</label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-row">
                                        <div class="col-md-3 mb-2">
                                            <label>患者病历</label>
                                            <div class="input-group">
                                                <textarea class="form-control" id="exampleTextarea1" v-model="patient.history" rows="3"></textarea>

                                            </div>
                                        </div>
                                        <div class="col-md-3 mb-3">
                                            <img id="img" src="../../assets/img/dashboard/headmodel.jpg "
                                                 class="ms-img-large ms-user-img mx-auto info" alt="people" v-bind:src="patient.headImg">
                                        </div>
                                    </div>
                                    <div class="form-row">
                                        <div class="col-md-3 mb-3">
                                            <label>性别</label>
                                            <ul class="ms-list d-flex">
                                                <li class="ms-list-item pl-0">
                                                    <label class="ms-checkbox-wrap">
                                                        <input type="radio" name="radioExample" value="男">
                                                        <i class="ms-checkbox-check"></i>
                                                    </label>
                                                    <span> 男性 </span>
                                                </li>
                                                <li class="ms-list-item">
                                                    <label class="ms-checkbox-wrap">
                                                        <input type="radio" name="radioExample" value="女" checked="">
                                                        <i class="ms-checkbox-check"></i>
                                                    </label>
                                                    <span> 女性 </span>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                    <button class="btn btn-warning mt-4 d-inline w-20" type="button">重置</button>
                                    <button class="btn btn-primary mt-4 d-inline w-20" type="submit">添加</button>
                                </form>

                            </div>
                        </div>

                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
<!-- Reminder Modal -->
<script src="../../assets/reuseCode/reminderModal.js"></script>
<!-- Notes Modal -->
<script src="../../assets/reuseCode/notesModal.js"></script>
<script src="../../assets/reuseCode/modal.js"></script>      <!-- SCRIPTS -->
<!-- Global Required Scripts Start -->
<script src="../../assets/js/jquery-3.3.1.min.js"></script>
<script src="../../assets/js/popper.min.js"></script>
<script src="../../assets/js/bootstrap.min.js"></script>
<script src="../../assets/js/perfect-scrollbar.js"></script>
<script src="../../assets/js/jquery-ui.min.js"></script>
<!-- Global Required Scripts End -->
<!-- Page Specific Scripts Start -->
<script src="../../assets/js/slick.min.js"></script>
<script src="../../assets/js/moment.js"></script>
<script src="../../assets/js/jquery.webticker.min.js"></script>
<script src="../../assets/js/Chart.bundle.min.js"></script>
<script src="../../assets/js/Chart.Financial.js"></script>
<!-- Page Specific Scripts Finish -->
<!-- Page Specific Scripts Start -->
<script src="../../assets/js/datatables.min.js"></script>
<!--<script src="../../assets/js/data-tables.js"></script>-->
<!-- Page Specific Scripts End -->
<!-- Mednalytics core JavaScript -->
<script src="../../assets/js/framework.js"></script>
<!-- Settings -->
<script src="../../assets/js/settings.js"></script>
<script src="../../assets/js/patient/patient-list.js"></script>
</body>
</html>
